﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MvcBlog.ViewModels.EntryViewModel>" validateRequest="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Create
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<% if (Request.IsAuthenticated)
   { %>
    <h2>Eintrag verfassen</h2>

    <% using (Html.BeginForm())
       {%>
        <%: Html.ValidationSummary(true)%>

        <fieldset>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Subject)%>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Subject)%>
                <%: Html.ValidationMessageFor(model => model.Subject)%>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Body)%>
            </div>
            <div class="editor-field">
                <%: Html.TextAreaFor(model => model.Body)%>
                <%: Html.ValidationMessageFor(model => model.Body)%>
            </div>
            
            <p>
                <input type="submit" value="Eintrag speichern" />
            </p>
        </fieldset>

    <% }
   }
   else
   { %>
       Anmelden, um einen neuen Eintrag anzulegen [ <%: Html.ActionLink("Log On", "Index", "Login") %> ]
   <% } %>


</asp:Content>

